Repository navigation
Conversation
SP3_add_python_module always linked pybind11::lto, so every python module was built with LTO in Release and MinSizeRel builds. Add the option SP3_ENABLE_LINK_TIME_OPTIMIZATION, OFF by default like SOFA's SOFA_ENABLE_LINK_TIME_OPTIMIZATION, and warn when it is ON in Debug or RelWithDebInfo builds, where pybind11 ignores it. Only link pybind11::lto when the target exists: pybind11 does not create it when CMAKE_INTERPROCEDURAL_OPTIMIZATION is set, which made the configure fail.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SP3_add_python_module always linked pybind11::lto, so every python module was built with LTO in Release and MinSizeRel builds.
Add the option SP3_ENABLE_LINK_TIME_OPTIMIZATION, OFF by default like SOFA's SOFA_ENABLE_LINK_TIME_OPTIMIZATION, and warn when it is ON in Debug or RelWithDebInfo builds, where pybind11 ignores it.
Only link pybind11::lto when the target exists: pybind11 does not create it when CMAKE_INTERPROCEDURAL_OPTIMIZATION is set, which made the configure fail.
for in-tree compilation, LTO will be set in any case if SOFA's one is set (propagated from Sofa.Config)
So, for LTO state:
if SOFA off and SP3 off -> no LTO
if SOFA on and SP3 off -> LTO (all)
if SOFA on and SP3 on -> LTO (all)
if SOFA off and SP3 on -> LTO (only SP3)
for out of tree, only SP3_ENABLE_LINK_TIME_OPTIMIZATION is taken into account.